package com.it.water.controller.HttpController;

import com.it.water.common.Result;
import com.it.water.service.ISendVerifyCodeService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 发送验证码控制器
 *
 * @author <a href="mailto:2038322151@qq.com">Miraitowa_zcx</a>
 * @author HelloWord505
 * @version 1.0
 * @since 2024-03-17
 */
@RestController
@RequestMapping("/sendVerify")
@CrossOrigin
public class SendVerifyCodeController {

    /**
     * 发送验证码服务
     */
    @Resource
    private ISendVerifyCodeService sendVerifyCodeService;

    /**
     * 发送验证码
     */
    @GetMapping("/send")
    public Result<String> send(String phone) {
        sendVerifyCodeService.send(phone);
        return Result.success();
    }
}
